﻿using System;
using System.Data;
using System.Collections.Generic;
using eTMS.Controllers.PhongHocNgayNghiService;
namespace eTMS.Controllers{
public class PhongHocNgayNghiControllerBase : CommonController{
	public PhongHocNgayNghiControllerBase()
		: base()
	{	
		this.dao = new PhongHocNgayNghiServiceClient();
	}
	protected PhongHocNgayNghiServiceClient dao;
	~PhongHocNgayNghiControllerBase(){
		try{dao.Close();}catch{}
	}
    //Copy data from data row in grid to object
    public PhongHocNgayNghiEntity MapDataRowToObject(DataRow row){
		PhongHocNgayNghiEntity o = new PhongHocNgayNghiEntity();
		 if(!row.IsNull("PhongHoc_ID"))
			o.PhongHoc_ID=(Int32)(row["PhongHoc_ID"]);
		 if(!row.IsNull("Thu_ID"))
			o.Thu_ID=(Int32)(row["Thu_ID"]);
		 if(!row.IsNull("TietHoc_ID"))
			o.TietHoc_ID=(Int32)(row["TietHoc_ID"]);
		 if(!row.IsNull("PhongHocNgayNghi_ID"))
		    o.PhongHocNgayNghi_ID=(Int32)(row["PhongHocNgayNghi_ID"]);
		 return o;
    }
	//Copy data from object to data row in grid    
    public void MapObjectToDataRow(PhongHocNgayNghiEntity o,DataRow row){
		row["PhongHoc_ID"]=o.PhongHoc_ID;
		row["Thu_ID"]=o.Thu_ID;
		row["TietHoc_ID"]=o.TietHoc_ID;
		row["PhongHocNgayNghi_ID"]=o.PhongHocNgayNghi_ID;
    }
}
}
